package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Objects;

@Entity
public class Zshipmentsdetails {
    private int shipmentsdetailsId;//发货单详情id
    private Qproductdetail prodetailId;//产品
    private Zshipments shipmentsId;//发货单
    private BigDecimal shipmentsdetailsNumber;//产品数量
    private BigDecimal shipmentsdetailsDbumber;//打包件数

    @Id
    @Column(name = "shipmentsdetails_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getShipmentsdetailsId() {
        return shipmentsdetailsId;
    }

    public void setShipmentsdetailsId(int shipmentsdetailsId) {
        this.shipmentsdetailsId = shipmentsdetailsId;
    }

    @ManyToOne
    @JoinColumn(name = "prodetail_id", referencedColumnName = "prodetail_id")
    public Qproductdetail getProdetailId() {
        return prodetailId;
    }

    public void setProdetailId(Qproductdetail prodetailId) {
        this.prodetailId = prodetailId;
    }

    @ManyToOne
    @JoinColumn(name = "shipments_id", referencedColumnName = "shipments_id")
    public Zshipments getShipmentsId() {
        return shipmentsId;
    }

    public void setShipmentsId(Zshipments shipmentsId) {
        this.shipmentsId = shipmentsId;
    }

    @Basic
    @Column(name = "shipmentsdetails_dbnumber")
    public BigDecimal getShipmentsdetailsDbumber() {
        return shipmentsdetailsDbumber;
    }

    public void setShipmentsdetailsDbumber(BigDecimal shipmentsdetailsDbumber) {
        this.shipmentsdetailsDbumber = shipmentsdetailsDbumber;
    }

    @Basic
    @Column(name = "shipmentsdetails_number")
    public BigDecimal getShipmentsdetailsNumber() {
        return shipmentsdetailsNumber;
    }

    public void setShipmentsdetailsNumber(BigDecimal shipmentsdetailsNumber) {
        this.shipmentsdetailsNumber = shipmentsdetailsNumber;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Zshipmentsdetails that = (Zshipmentsdetails) o;
        return shipmentsdetailsId == that.shipmentsdetailsId &&
                Objects.equals(prodetailId, that.prodetailId) &&
                Objects.equals(shipmentsId, that.shipmentsId) &&
                Objects.equals(shipmentsdetailsNumber, that.shipmentsdetailsNumber);
    }

    @Override
    public int hashCode() {
        return Objects.hash(shipmentsdetailsId, prodetailId, shipmentsId, shipmentsdetailsNumber);
    }
}
